<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/admin.css">
    <script src="https://cdn.jsdelivr.net/npm/echarts@4.9.0/dist/echarts.min.js"></script>
    <title>许久没道过早安的后台</title>
    <style>
        #echart{
            margin: auto;
            width: 800px;
            height:600px;
        }
    </style>
</head>
<body>
<div class="body">
    <div class="layui-fluid">
        {include file='public/sider' /}
        <div id="index">
            {include file='public/header' /}

            <div class="layui-fluid" id="body">
                <div class="layui-card">
                    <div class="layui-card-header">
                        访问量统计
                    </div>
                    <div class="layui-card-body">
                        <div id="echart"></div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<script src="/static/layui/layui.js"></script>
<script>
    var height = window.screen.availHeight;
    document.getElementById('body').style.height = parseInt(height) - 190 + "px";
    document.getElementById('sider').style.height = parseInt(height) - 165 + "px";
</script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('echart'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '访问量(7日)统计,总计访问量(UV){$num7},PV总量：{$pv_num}'
        },
        tooltip: {},
        legend: {
            data:['7日内UV数']
        },
        xAxis: {
            data: ["{$date1}","{$date2}","{$date3}","{$date4}","{$date5}","{$date6}","{$date7}"]
        },
        yAxis: {},
        series: [{
            name: 'UV量',
            type: 'line',
            data: [{$num1 - $num0}, {$num2 - $num1}, {$num3 - $num2}, {$num4 - $num3}
            , {$num5 - $num4}, {$num6 - $num5},{$num7 - $num6}]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
</html>